<template>
	<!-- 鸡汤图标组件 在首页和详情页都用到了 -->
	<view class="soupTabGroup">

		<view class="tab djt" v-if="soupType===0">
			<view class="icon">
				<image src="../../static/images/du-icon.png"></image>
			</view>
			<view class="text">毒鸡汤</view>
		</view>

		<view class="tab xljt" v-if="soupType===1">
			<view class="icon">
				<image src="../../static/images/xin-icon.png"></image>
			</view>
			<view class="text">心灵鸡汤</view>
		</view>

	</view>
</template>

<script setup>
	defineProps({
		// 是否是毒鸡汤
		soupType: {
			type: Number,
			default: 0
		}
	})
</script>

<style scoped lang="scss">
	.soupTabGroup {
		.tab {
			height: 56rpx;
			width: fit-content; // 文字多大边框多大
			background: #aaa;
			display: flex;
			align-items: center;
			font-size: 26rpx;
			font-weight: 400;
			letter-spacing: normal;
			padding: 0 20rpx;
			border-radius: 56rpx;

			.icon {
				display: flex;
				width: 36rpx;
				height: 36rpx;
				border-radius: 50%;
				display: flex;
				align-items: center;
				justify-content: center;

				image {
					width: 80%;
					height: 80%;
				}
			}

			.text {
				padding-left: 10rpx;
			}
		}

		// 分别定义两个tab不同的颜色
		.tab.djt {
			background: #fff3f7;

			.icon {
				background: linear-gradient(to right, #f83162, #ff7795);
			}
		}

		.tab.xljt {
			background: #EDFDF0;

			.icon {
				background: linear-gradient(to right, #f83162, #ff7795);
			}
		}

	}
</style>